Skip to content

Conversation

@clement-ux
Copy link
Contributor

Description

Create a Router for ARM.

clement-ux and others added 30 commits October 31, 2025 11:50
- Introduced SwapType enum for distinguishing between ARM and Wrapper swaps.
- Implemented swapTokensForExactTokens function in ARMRouter.
- Updated internal swap logic to handle exact token swaps.
- Created unit tests for swapTokensForExactTokens functionality.
- Enhanced MockWrapper with functions for price queries.
- Updated shared test setup to register new configurations.
@clement-ux clement-ux marked this pull request as ready for review November 4, 2025 09:01
@clement-ux
Copy link
Contributor Author

clement-ux commented Nov 5, 2025

Comment on Gas-Golfing

Here is the gas-reduction report from gas-golfing session:
Comparison between commit fe5e0fc and 87b15f7
DiffChecker:https://github.com/OriginProtocol/arm-oeth/compare/fe5e0fc..87b15f7

ExactTokensForTokens

image

TokensForExactTokens

image

Conclusion

I average this is a -0.3% of gas consumption. This is good, but this comes at the expense of code smoothness. Does it makes sense to keep these changes @naddison36?

@clement-ux
Copy link
Contributor Author

clement-ux commented Nov 7, 2025

Gas Optimization Reduction Summary

Overview

This report compares Initial vs Final gas costs across various swap operations. All values represent reductions (negative numbers indicate cost decreases).

Detailed Breakdown

Operation Initial Final Reduction % Change
ETHForExactTokens: EETH 104,345 102,735 -1,610 -1.54%
ExactETHForTokens: EETH 92,711 91,513 -1,198 -1.29%
ExactTokensForETH: EETH 128,592 126,906 -1,686 -1.31%
ExactTokensForTokens: Bypass Router: EETH_WETH 46,739 46,303 -436 -0.93%
ExactTokensForTokens: EETH_WETH 83,120 81,819 -1,301 -1.56%
ExactTokensForTokens: WEETH_WETH 108,774 107,050 -1,724 -1.59%
ExactTokensForTokens: WEETH_WSTETH 277,719 274,333 -3,386 -1.22%
ExactTokensForTokens: WETH_EETH 80,753 79,518 -1,235 -1.53%
ExactTokensForTokens: WETH_WEETH 189,946 187,924 -2,022 -1.06%
ExactTokensForTokens: WSTETH_WEETH 277,719 274,333 -3,386 -1.22%
TokensForExactETH: EETH 133,209 131,089 -2,120 -1.59%
TokensForExactTokens: Bypass Router: EETH_WETH 46,858 46,398 -460 -0.98%
TokensForExactTokens: EETH_WETH 87,759 86,052 -1,707 -1.94%
TokensForExactTokens: WEETH_WETH 115,851 113,441 -2,410 -2.08%
TokensForExactTokens: WEETH_WSTETH 291,247 286,829 -4,418 -1.52%
TokensForExactTokens: WETH_EETH 85,273 83,677 -1,596 -1.87%
TokensForExactTokens: WETH_WEETH 196,776 194,240 -2,536 -1.29%
TokensForExactTokens: WSTETH_WEETH 291,202 286,784 -4,418 -1.52%

Summary Statistics

  • Average Reduction per Operation: -2,236 units
  • Average Percentage Reduction: -1.43%
  • Largest Single Reduction: -4,418 units (WEETH_WSTETH operations)
  • Smallest Single Reduction: -436 units (Bypass Router: EETH_WETH)

Note:

  • Reduction on tests Bypass Router correspond to reduction obtained thanks to increasing optimizor_runs from 200 to 50000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants